
package main

import (
	log "github.com/sirupsen/logrus"
	"github.com/lestrrat-go/file-rotatelogs"
	"time"
)



func ConfigLocalFilesystemLogger1(filePath string) {
	writer, err := rotatelogs.New(
		filePath+".%Y%m%d%H%M",
		rotatelogs.WithLinkName(filePath),         // 生成软链，指向最新日志文件
		rotatelogs.WithMaxAge(time.Second*86400*7),     // 文件最大保存时间
		rotatelogs.WithRotationTime(time.Second*86400), // 日志切割时间间隔
	)
	if err != nil {
		log.Fatal("Init log failed, err:", err)
	}
	log.SetOutput(writer)
	log.SetLevel(log.DebugLevel)
}

func main() {

	log.Info(111)
	log.Errorf("name is %s", "lynzhang")
	log.Info(3333)

}
